package org.jeecg.modules.bigdatashow.controller;

import org.jeecg.modules.bigdatashow.entity.Common;
import org.jeecg.modules.bigdatashow.entity.CommonResult;
import org.jeecg.modules.bigdatashow.entity.TsMonth;
import org.jeecg.modules.bigdatashow.entity.Weather;
import org.jeecg.modules.bigdatashow.service.WeatherTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class WeatherTimeController {
    @Autowired
    private WeatherTimeService weatherTimeService;

    @GetMapping(value = "/findWeather",produces = "application/json; charset=utf-8")
    public CommonResult findWeather(){
        List<Weather> AllWeather  = weatherTimeService.findWeather();
        if (AllWeather != null){
            return new CommonResult(200,"右3:各天气下的游客信息为:",AllWeather);
        }else {
            return new CommonResult(404,"未查询信息:");
        }
    }
    @GetMapping(value = "/findTime",produces = "application/json; charset=utf-8")
    public CommonResult findTime(){
        List<Common> AllTime  = weatherTimeService.findTime();
        if (AllTime != null){
            return new CommonResult(200,"中1:各时间段的游客信息为:",AllTime);
        }else {
            return new CommonResult(404,"未查询信息:");
        }
    }
}
